package com.example.mysaat.service_menu_manual_test;

import android.app.Activity;
import android.os.Bundle;
import android.widget.ListAdapter;
import android.widget.ListView;

import com.example.mysaat.MyArrayAdapter;
import com.example.mysaat.R;
import com.example.mysaat.handle_utils.AbstarcParse;
import com.example.mysaat.handle_utils.XMLDatabase;
import com.example.mysaat.service_menu_manual_test.Listeners.MyManualTestOnItemListener;

public class ServiceMenuManualTest extends Activity {
    private ListView listView = null;
    private ListAdapter adapter =null;
    private AbstarcParse parser=null;
    private String[]datas = null;


    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_service_menu_manual_test);
        parser  = new XMLDatabase();
        init();
        initContent();
        //添加点击对象的监听事件
        listView.setOnItemClickListener(new MyManualTestOnItemListener());
    }
    //将View进行赋值
    private void init(){
        listView = findViewById(R.id.manual_test_list_view);
    }
    //初始化View的数据
    private void initContent(){
        datas = (String[]) parser.getParseData("service_menu_manual_direction",R.xml.service_menu_manual_direction);
        adapter = new MyArrayAdapter(this,android.R.layout.simple_list_item_1,datas);
        listView.setAdapter(adapter);
    }

}
